home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_input_text.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-09  |  5.5 KB  |  105 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="430" height="310" caption="Text field">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label name="lblMaxChars" caption="Maximum characters" hint="Maximum number of characters allowed." width="84" height="13" top="56" left="200"/>
  6.             <label name="lblSize" caption="Size" hint="Size of the element measured in number of characters." width="52" height="13" top="56" left="8"/>
  7.             <label name="lblValue" caption="Text/value" hint="Text/value of your form element." width="69" height="13" top="8" left="200"/>
  8.             <label name="lblName" caption="Name" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="29" height="13" top="8" left="8"/>
  9.             <edit name="edtName" taborder="0" text="" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="175" height="19" top="24" left="8"/>
  10.             <edit name="edtValue" taborder="1" text="" hint="Text/value of your form element." width="175" height="19" top="24" left="200"/>
  11.             <spinedit name="speSize" taborder="2" hint="Size of the element measured in number of characters." maxvalue="0" minvalue="0" value="0" width="175" height="20" top="72" left="8"/>
  12.             <spinedit name="speMaxLength" taborder="3" hint="Maximum number of characters allowed." maxvalue="0" minvalue="0" value="0" width="175" height="20" top="72" left="200"/>
  13.             <checkbox name="cbReadonly" caption="Readonly" taborder="4" hint="If your element is readonly, the user will not be able to make any changes to it." checked="0" width="121" height="17" top="104" left="8"/>
  14.             <checkbox name="cbDisabled" caption="Disabled" taborder="5" hint="Your element will be visible, but disabled." checked="0" width="121" height="17" top="104" left="200"/>
  15.         </panel>
  16.     </controls>
  17.     <dialogevents>
  18.         <event type="onclose" resulttype="ok">
  19.  
  20.             StartCode := '<input type="text"';
  21.             If edtName.Text <> '' then
  22.              StartCode := Startcode + ' name="'+(edtName.Text)+'"';
  23.             If edtValue.Text > '' then
  24.              StartCode := Startcode + ' value="'+(edtValue.Text)+'"';
  25.             If speSize.Value > 0 then
  26.              StartCode := Startcode + ' size="'+IntToStr(speSize.Value)+'"';
  27.             if speMaxLength.Value > 0 then
  28.              StartCode := Startcode + ' maxlength="'+(IntToStr(speMaxLength.Value))+'"';
  29.             if cbReadonly.Checked then
  30.              StartCode := Startcode + ' readonly';
  31.             if cbDisabled.Checked then
  32.               StartCode := Startcode + ' disabled';
  33.   
  34.               If edtCSSClass.Text <> '' then
  35.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  36.               If edtCSSId.Text <> '' then
  37.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  38.               If edtCSSStyle.Text <> '' then
  39.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  40.             for i := 0 to EventGrid.Count - 1 do
  41.               begin
  42.               if EventGrid.Rows[i].EditText <> '' then
  43.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  44.              end;    
  45.  
  46.             StartCode := StartCode + '>';
  47.             If cbMakeXHTMLCompliant.Checked then
  48.              StartCode := MakeXHTMLCompliant(StartCode, false);
  49.             If cbDoPHPEscape.Checked then
  50.              StartCode := DoPHPEscape(StartCode);         
  51.             // A little "hack" - WebCoder will set this, to let us know whether to update
  52.             // an existing tag, or insert a brand new one
  53.             If cbUpdateExistingTag.Checked then 
  54.              ReplaceTag(StartCode)
  55.             else 
  56.                InsertTags(StartCode, '');   
  57.               
  58.         </event>
  59.         <event type="onshow">    
  60.             // Lets put the advanced panel in the right place
  61.             pnlAdvanced.Parent := MainPanel;
  62.             pnlAdvanced.Left := 8;
  63.             pnlAdvanced.Top := MainPanel.Height - 32;        
  64.             pnlAdvanced.Width := Self.Width - 36;
  65.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  66.             If pnlAdvanced.Height > 20 then
  67.              Self.Height := Self.Height + 200;
  68.         </event>
  69.         <event type="updatedialog">
  70.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  71.             // The entire selected tag will be passed as a parameter to this function, that should update
  72.             // the required fields of the dialog.
  73.             function UpdateDialog(Tag: string);
  74.              begin
  75.             
  76.               edtName.Text := GetValueFromAttribute(Tag, 'name');
  77.               edtValue.Text := GetValueFromAttribute(Tag, 'value');
  78.               
  79.               Size := GetValueFromAttribute(Tag, 'size');
  80.               If Size <> '' then
  81.                speSize.Value := StrToInt(Size);
  82.              
  83.               MaxLength := GetValueFromAttribute(Tag, 'maxlength');
  84.               If MaxLength <> '' then
  85.                speMaxLength.Value := StrToInt(MaxLength);
  86.               
  87.               cbReadonly.Checked := HasOption(Tag, 'readonly'); 
  88.               cbDisabled.Checked := HasOption(Tag, 'disabled'); 
  89.             
  90.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  91.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  92.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  93.               for i := 0 to EventGrid.Count - 1 do
  94.                 begin
  95.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  96.                  If EventVal <> '' then
  97.                   EventGrid.Rows[i].EditText := EventVal;
  98.                end;  
  99.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  100.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                            
  101.              end;
  102.         </event>
  103.     </dialogevents>
  104. </dialog>
  105.